<!DOCTYPE html>
<html>
<head>
<title>datagrid-filter行过滤</title>
<meta charset="UTF-8" />
<script type="text/javascript" src="/js/easyui.js"></script>
<script type="text/javascript" src="/js/properties.js"></script>
<script type="text/javascript" src="/js/datagrid-filter.js"></script>
<style type="text/css">
/* 加粗标题字体 */
.datagrid-header-row td{font-weight:bolder}
body{
	margin:0px;
	padding:0px;
}
</style>
</head>

<body>
<div id="querycondition">
	<span id="qcontentsspan">
	其他字段:
	<input class="easyui-textbox" id="pcontents"  style="width:200px" data-options="prompt: '输入要查询的内容!'"/>
	</span>
	<a id="querybtn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a> 
</div>
<form id="form1">
    <div>
       	<table id="tb" style="width: 950px"  class="easyui-datagrid" data-options="singleSelect:false,striped:true,iconCls:'icon-edit',nowrap:false">  
       	</table> 
   	</div>
</form>
</body>
<script type="text/javascript">
$(function () {
   	 $("#tb").datagrid({
         url: serverUrl+'/qualityControl/menu1/findAll2',
         singleSelect:true,
         rownumbers:true,
         pagination:true,
         pageNumber:1, 
         pageSize:2,
         pageList:[2,4],
         //queryParams:{'salesTel':''},
 		 fitColumns:true,
 		 striped:true,
         remoteFilter: true,  
         filterDelay: 400,  
    	 filterRules: ['comName','address'], 
         onLoadError: function (e) {
             alert("异常："+e);
         },
 	     columns:[[
			{field:'cc',title:'',width:10,align:'center'},
			{field:'comName',title:'公司名称',width:150,align:'center'},
	  		{field:'address',title:'地址',width:150,align:'center'},
	  		{field:'salesTel',title:'电话',width:150,align:'center'} 
	  	 ]],
     	 toolbar:'#querycondition',
     	 /* onLoadSuccess:function(){
     		$("div[class='datagrid-view2'] table[class='datagrid-htable'] tbody tr:eq(1) td:eq(0)").html("<img src='../../../common/easyui/themes/icons/clear.png' id='imgclear'/>");
       		$('#imgclear').bind('click',function(){//清空行查询条件
       			$("#tb").datagrid('clearColumnsquery',['address','comName']);
       		});
     	 } */
     });
	 $("#tb").datagrid('enableFilter');//启动行过滤
	 $("#tb").datagrid('noFilterColumns',['cc','salesTel']);//非查询字段
     $('#clearbtn').bind('click',function(){//清空行查询条件
    	 $("#tb").datagrid('clearColumnsquery',['address','comName']);
     });
}); 
</script>

</html>